// Caraway, Rickard, and Anner 2012 IO

// Load original dataset
clear
use "CRA2012 IO Rep Data.dta"

// REPLICATION
summarize
display c(k)
mdesc
tabmiss
codebook ccode
codebook year
gen ellngdppc = exp(llngdppc)
summarize

*Table 2
nbreg  mefp lnewplp ltenpolity2 lfiring linline llngdppc llngdpconstant  ldebt docs trend, r cluster(ccode)
mdesc  mefp lnewplp ltenpolity2 lfiring linline llngdppc llngdpconstant  ldebt docs trend
codebook year if e(sample)
codebook ccode if e(sample)

nbreg  mefp lnewplp ltenpolity2 iltenpolity2_lnewplp lfiring linline llngdppc llngdpconstant ldebt docs trend, r cluster(ccode)
mdesc  mefp lnewplp ltenpolity2 iltenpolity2_lnewplp lfiring linline llngdppc llngdpconstant ldebt docs trend
codebook year if e(sample)
codebook ccode if e(sample)

nbreg  arr lnewplp ltenpolity2 lfiring linline llngdppc llngdpconstant  ldebt docs trend, r cluster(ccode)
mdesc  arr lnewplp ltenpolity2 lfiring linline llngdppc llngdpconstant  ldebt docs trend
codebook year if e(sample)
codebook ccode if e(sample)

nbreg  arr lnewplp ltenpolity2 iltenpolity2_lnewplp lfiring linline llngdppc llngdpconstant ldebt docs trend, r cluster(ccode)
mdesc  arr lnewplp ltenpolity2 iltenpolity2_lnewplp lfiring linline llngdppc llngdpconstant ldebt docs trend
codebook year if e(sample)
codebook ccode if e(sample)

// IMPUTATION
clear
use "CRA2012 IO Imp Data.dta"
summarize
mi import flong, m(imp) id(ccode year) imp(mefp-ilexecleft_lnewplp)

*Table 2
mi estimate, post: nbreg  mefp lnewplp ltenpolity2 lfiring linline llngdppc llngdpconstant  ldebt docs trend, r cluster(ccode)

mi estimate, post: nbreg  mefp lnewplp ltenpolity2 iltenpolity2_lnewplp lfiring linline llngdppc llngdpconstant ldebt docs trend, r cluster(ccode)

mi estimate, post: nbreg  arr lnewplp ltenpolity2 lfiring linline llngdppc llngdpconstant  ldebt docs trend, r cluster(ccode)

mi estimate, post: nbreg  arr lnewplp ltenpolity2 iltenpolity2_lnewplp lfiring linline llngdppc llngdpconstant ldebt docs trend, r cluster(ccode)

